<!DOCTYPE html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <title>土豪520</title>
    <meta name="description" content="">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui, user-scalable=no">
    <meta http-equiv="cleartype" content="on">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/assets/activity/lighting/css/index.css">
    <link rel="stylesheet" href="/assets/activity/lighting/css/font.css">
    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<style>
		.share {
		    margin: 12px 0 20px 50%;
		    width: 40%;
		}
		.share-btn {
		    background: none repeat scroll 0 0 #20ab98;
		    border-radius: 4px;
		    display: inline-block;
		    font-size: 14px;
		    margin-top: 30px;
		    padding: 4px 15px;
		    width: 114px;
		}
	</style>
	<script type="text/javascript">
	wx.config({
		debug: false,
		appId: "{BEESCRM:$appid}",
		timestamp: "{BEESCRM:$timestamp}",
		nonceStr: "{BEESCRM:$noncestr}",
		signature: "{BEESCRM:$signature}",
		jsApiList: ['checkJsApi','onMenuShareTimeline','onMenuShareAppMessage','hideOptionMenu','scanQRCode'],
	});
	
	wx.ready(function(){
		var url = '{BEESCRM:$share_url}';
		var imgUrl = '{BEESCRM:$share_image}';
		var title = '{BEESCRM:$share_title}';
		var desc = '{BEESCRM:$share_desc}';
		//分享到朋友圈
		wx.onMenuShareTimeline({
			title: title, // 分享标题
			link: url, // 分享链接
			imgUrl: imgUrl, // 分享图标
			success: function () { 
				share(); 
			},
			cancel: function () { 
				// 用户取消分享后执行的回调函数
				/* alert('已取消'); */
			}
		});
		//发送给好友
		wx.onMenuShareAppMessage({
			title: title, // 分享标题
			desc: desc, // 分享描述
			link: url, // 分享链接
			imgUrl: imgUrl, // 分享图标
			success: function () { 
				// 用户确认分享后执行的回调函数
				share();
			},
			cancel: function () { 
				// 用户取消分享后执行的回调函数
			}
		});
	});
	//分享
	var act_id = '{BEESCRM:$act_id}';
	var wechat_id = '{BEESCRM:$wechat_id}';
	var fans_id = '{BEESCRM:$fans_id}';
	var from_fans_id = '{BEESCRM:$from_fans_id}';
	var origin = '{BEESCRM:$origin}';
	if(!origin){
		origin = 'prizeshare';
	}
	var share_callback_url = "/activity/lighting/share/act_id/"+act_id+"/wechat_id/"+wechat_id+"/fans_id/"+fans_id+"/from_fans_id/"+from_fans_id+"/origin/"+origin+"/action_name/prize";
	//alert(share_callback_url);
	//console.log(share_callback_url);
	//分享log
	function share(){
		var url;
		url = share_callback_url;
		$.ajax({
			type:'post',
			dataType:'json',
			url:url,
		});
	}  
</script>
</head>

<body>
<div class="wraper">
    <div class="logo">
        <a href="#" class="top">
            <img src="/assets/activity/lighting/images/hongyan.png">
            <img class="title" src="/assets/activity/lighting/images/title.png"/>
        </a>
        <img src="/assets/activity/lighting/images/logo.png">
    </div>
    <if condition="$mine eq 3">
    	<div class="prize">
	        <p class="text1">我获得了鸿雁送出的{BEESCRM:$data.name}电影代金券</p>
	        <p class="text2">你要不要？</p>
	        <a class="img-btn" href="{BEESCRM::U('activity/lighting/index',array('wechat_id'=>$wechat_id, 'act_id'=>$act_id, 'origin'=>$origin))}"><img src="/assets/activity/lighting/images/youwant.png"/></a>
	    </div>
    <else/>
    	<div class="prize">
	        <p class="text1">恭喜你获得 <span>{BEESCRM:$data.name}</span> 电影券！</p>
	        <p class="text1">请记录以下代金券编码</p>
	        <p class="code">{BEESCRM:$data.code}</p>
	    </div>
    </if>

    <div class="wave-bottom"></div>
    <p class="label">
        代金券使用方法
    </p>
    <div class="direction">
       <!-- <img src="/assets/activity/lighting/images/bill.jpg"/> -->
        <p>{BEESCRM:$data.rule}</p>
    </div>
    <div class="adds" style="padding-top: 10px;">
        <a href="{BEESCRM:$subscribe_url}"><p class="copy-right">技术支持：杭州青橄榄网络技术有限公司</p></a>
    </div>
    <if condition="$mine eq 3">
	    <div>
	        <a href="{BEESCRM::U('activity/lighting/index',array('wechat_id'=>$wechat_id, 'act_id'=>$act_id, 'origin'=>$origin))}" class="btn">我也要玩</a>
	    </div>
	<elseif condition="$mine eq 1" />
		<div>
	        <a href="javascript:void(0)" class="btn share-box" >分享炫耀一下</a>
	    </div>
	<elseif condition="$mine eq 2" />
		<div>
	        <a href="{BEESCRM::U('activity/lighting/index',array('wechat_id'=>$wechat_id, 'act_id'=>$act_id, 'origin'=>$origin))}" class="btn">再玩一次</a>
	    </div>
    </if>
    
    <div class="pop-box" id="share">
	        <div class="share"><img src="/assets/activity/lighting/images/share_icon.png"/></div>
	        <div class="main">
	            <p>想要记录你的电影票代码？</p>
	            <p>那就直接分享朋友圈吧~</p>
	            <p>收藏&炫耀两不误</p>
	            <p>谁说我永远抽不中奖来着？</p>
	            <p>点击右上角</p>
	            <p>分享朋友圈！</p>
	          <!--   <a class="share-btn">我知道了</a>-->
 	        </div>
	    </div>
    
</div>

<script src="/assets/activity/lighting/js/jquery-2.1.0.min.js"></script>
<script type="text/javascript" src="/assets/activity/lighting/js/lottery.js"></script>
<script type="text/javascript" src="/assets/activity/lighting/js/slick.min.js"></script>
<script type="text/javascript" src="/assets/activity/lighting/js/fastclick.min.js"></script>
<script>
$('.share-box').click(function(){
	$('#share').show();
});
$('.close-btn').click(function(){
	$(this).closest('.pop-box').hide();
})

</script>
</body>


</html>
